<?php

use App\Admin\Extensions\WangEditor;
use Dcat\Admin\Admin;
use Dcat\Admin\Form;
use Dcat\Admin\Layout\Navbar;

/**
 * Dcat-admin - admin builder based on Laravel.
 * @author jqh <https://github.com/jqhph>
 *
 * Bootstraper for Admin.
 *
 * Here you can remove builtin form field:
 *
 * extend custom field:
 * Dcat\Admin\Form::extend('php', PHPEditor::class);
 * Dcat\Admin\Grid\Column::extend('php', PHPEditor::class);
 * Dcat\Admin\Grid\Filter::extend('php', PHPEditor::class);
 *
 * Or require js and css assets:
 * Admin::css('/packages/prettydocs/css/styles.css');
 * Admin::js('/packages/prettydocs/js/main.js');
 *
 */
// 覆写config中admin的配置
//$name = admin_setting('web_name');
//$logo = '<img src="'.env('APP_URL').':'.$_SERVER["SERVER_PORT"].'/uploads/'.admin_setting('logo').'" width="35"> &nbsp;'.$name;
//$logo_mini = '<img src="'.env('APP_URL').':'.$_SERVER["SERVER_PORT"].'/uploads/'.admin_setting('logo').'">';
//
//config([
//    'admin.logo' => $logo,
//    'admin.logo-mini' => $logo_mini
//]);

config([
    'app.locale' => session('language') ?: 'en',
]);

Admin::navbar(static function (Navbar $navbar) {
    $navbar->right(view('admin.pages.switching-languages'));
});
